export abstract class Shape {
  protected _x?: number;
  protected _y?: number;
  protected _strokeStyle: string;
  protected _fillStyle: string;

  constructor(
    x?: number,
    y?: number,
    strokeStyle?: string,
    fillStyle?: string
  ) {
    this._x = x;
    this._y = y;
    this._strokeStyle = strokeStyle || "rgba(255, 253, 208, 0.9)";
    this._fillStyle = fillStyle || "rgba(147, 197, 114, 0.8)";
  }

  /** 监测两个 shape 是否碰撞在一起 */
  collidesWith(_other: Shape) {}

  /**
   * 在 context 中创建一个 Path，用于后续的操作
   * @param ctx
   */
  abstract createPath(ctx: CanvasRenderingContext2D): void;
}
